home *** CD-ROM | disk | FTP | other *** search
/ Usenet 1993 July / InfoMagic USENET CD-ROM July 1993.ISO / sources / unix / volume9 / elm2 / patch01 < prev    next >
Encoding:
Internet Message Format  |  1987-03-12  |  21.9 KB

  1. Subject:  v09i032:  New Configure.sh for ELM, Patch1
  2. Newsgroups: mod.sources
  3. Approved: rs@mirror.TMC.COM
  4.  
  5. Submitted by: hplabs!taylor (Dave Taylor)
  6. Mod.sources: Volume 9, Issue 32
  7. Archive-name: elm2/Patch1
  8.  
  9. NOTE!  The "Configure.sh" file distributed with ELM is badly broken.
  10. It unpacks correctly, and appears to be missing like a 512 bytes or
  11. so.  Here it is, re-loaded from the tape, re-verified, re-packed,
  12. etc.  Sorry for the confusion.
  13.     /r$
  14.  
  15. #! /bin/sh
  16. # This is a shell archive.  Remove anything before this line,
  17. # then unpack it by saving it in a file and typing "sh file".
  18. # If this archive is complete, you will see the message:
  19. #        "End of shell archive."
  20. # Contents:  Configure.sh
  21. PATH=/bin:/usr/bin:/usr/ucb ; export PATH
  22. echo shar: Extracting \"Configure.sh\" \(20310 characters\)
  23. if test -f Configure.sh ; then 
  24.   echo shar: Will not over-write existing file \"Configure.sh\"
  25. else
  26. sed "s/^X//" >Configure.sh <<'END_OF_Configure.sh'
  27. X: Use /bin/sh
  28. X#
  29. X# Configure.sh, a shell script for configuring the Elm mail system for
  30. X#     your site and desires.  This script uses some ideas ripped out
  31. X#    of the 'rn' install script.  Thanks Larry!
  32. X#
  33. X
  34. Xexport PATH || (sh $0 ; kill $$)
  35. X
  36. XSHELL=/bin/sh
  37. X
  38. XSED1=/tmp/Elm.sed1
  39. XSED2=/tmp/Elm.sed2
  40. X
  41. Xif [ -f /bin/rm ]
  42. Xthen
  43. X  rm=/bin/rm
  44. Xelse
  45. X  rm=rm
  46. Xfi
  47. X
  48. X$rm -f $SED1 $SED2
  49. Xtouch $SED1 $SED2
  50. Xchmod 777 $SED1 $SED2
  51. X
  52. X# first test - is stdin still free for answering questions??
  53. Xif [ ! -t 0 ]
  54. Xthen
  55. X  echo "Please use 'sh Configure.sh' rather than 'sh < Configure.sh'"
  56. X  exit 1
  57. Xfi
  58. X
  59. X# next let's see what sorta echo flag we have here...
  60. X
  61. Xif [ "`echo -n`" = "-n" ]
  62. Xthen
  63. X  nflag=""
  64. X  cflag="\\c" 
  65. Xelse
  66. X  nflag="-n"
  67. X  cflag=""
  68. Xfi
  69. X
  70. X# now the intro blurb
  71. X
  72. Xcat << END_OF_INTRO
  73. X
  74. X                   Elm Configuration Script, v4
  75. X       
  76. X      
  77. X    This is the configuration script for the Elm mail system.  By using
  78. X    it rather than editing the "hdrs/sysdefs.h" file, it is hoped that
  79. X    the installation process will be considerably easier.
  80. X
  81. X    On all questions, the value in [square brackets] is the default that 
  82. X    will be used if you just press RETURN...
  83. X
  84. X
  85. XEND_OF_INTRO
  86. X
  87. Xecho "Trying to figure out what sort of OS you're on..."
  88. X
  89. X# next interesting part - figure out what OS we're on
  90. X
  91. Xos_name=""
  92. X
  93. X$rm -f .osname
  94. Xtouch .osname
  95. X
  96. Xcat << 'EOF' > .get_osname
  97. X
  98. Xuname
  99. X
  100. Xif [ $? != 0 ] 
  101. Xthen
  102. X  if [ -f /vmunix ]
  103. X  then
  104. X    echo "bsd" > .osname
  105. X  else
  106. X    exit 0
  107. X  fi
  108. Xfi
  109. X
  110. Xif [ "`uname -s`" != "" ]
  111. Xthen
  112. X   uname -s | tr '[A-Z]' '[a-z]' > .osname
  113. Xfi
  114. X
  115. Xexit 0
  116. XEOF
  117. X
  118. Xsh .get_osname > /dev/null 2>&1
  119. X
  120. Xif [ -f .osname ] 
  121. Xthen
  122. X  os_name="`cat .osname`"
  123. X  $rm -f .osname
  124. Xfi
  125. X
  126. X$rm -f .get_osname
  127. X
  128. Xif [ "$os_name" = "" ] 
  129. Xthen
  130. X  cat << THE_END
  131. X
  132. XI cannot figure out what sort of operating system you're running here.  Please
  133. Xtype in the NAME of the OS you're running or the name of the machine you're
  134. XTHE_END
  135. X
  136. X  echo $nflag "running on.  I'll check the name in a minute : " $cflag
  137. X
  138. X  read junk morejunk
  139. X  
  140. X  os_name=`echo $junk | tr '[A-Z]' '[a-z]'`
  141. Xfi
  142. X
  143. XOS_FLAG="HUH??"
  144. X
  145. Xwhile [ "$OS_FLAG" = "HUH??" ]
  146. Xdo
  147. X
  148. X  case $os_name in
  149. X    hp)        NAME="HP-UX"; OS_FLAG=""        ;;
  150. X    hp-ux)     NAME="HP-UX"; OS_FLAG="";           ;;
  151. X    vax)    NAME="BSD"; OS_FLAG="BSD";      ;;
  152. X    vaxen)    NAME="BSD"; OS_FLAG="BSD";      ;;
  153. X    bsd)    NAME="BSD"; OS_FLAG="BSD";      ;;
  154. X    uts)    NAME="UTS"; OS_FLAG="UTS";      ;;
  155. X    sun)    NAME="BSD"; OS_FLAG="";        ;;
  156. X    pyramid)    NAME="Pyramid BSD"; OS_FLAG="PYRAMID";    ;;
  157. X    amdahl)    NAME="UTS"; OS_FLAG="UTS";      ;;
  158. X    sv_*)    NAME="System V"; OS_FLAG="";        ;;
  159. X    svii_*)    NAME="System VII"; OS_FLAG="";        ;;
  160. X    v5)        NAME="System V"; OS_FLAG="";        ;;
  161. X    v7)        NAME="System VII"; OS_FLAG="";        ;;
  162. X    eunice)    NAME="Eunice"; OS_FLAG="";        ;;
  163. X    convergent)    NAME="Convergent BSD"; OS_FLAG="BSD";        ;;
  164. X    berkeley)    NAME="BSD"; OS_FLAG="BSD";        ;;
  165. X    ultrix)    cat << THE_END
  166. X
  167. XI know that this is a breed of Unix, but I don't know what TYPE of OS it
  168. Xis like.  Please enter the NAME of the OS that this is most like (e.g. "BSD")
  169. Xand we'll go from there.
  170. X
  171. XTHE_END
  172. X                    ;;
  173. X    xenix)    cat << THE_END
  174. X
  175. XYou're outta luck.  Xenix (dumb OS that it is only allows 6 character 
  176. Xidentifier names.  You'll need to go in and LABORIOUSLY translate all the
  177. XVERY LONG identifier names to the right length.   The correct response to 
  178. Xseeing this message is to call your vendor and get ANGRY!!!!
  179. X
  180. XMeanwhile, we might as well just quit here.  Sorry.
  181. XTHE_END
  182. Xexit 1
  183. X                    ;;
  184. X    *)        cat << THE_END
  185. X
  186. XI don't know what OS you're specifying!  The only one's I know of are;
  187. X
  188. X  HP-UX, BSD, UTS, Eunice, Xenix, Ultrix, V5, and V7
  189. X
  190. XI also know the machines
  191. X
  192. X  HP, Amdahl, Sun, Vaxen, Convergent and Pyramid
  193. X
  194. XIf you're not among this list, you'll need to pick the closest OS name.  
  195. XTHE_END
  196. X
  197. X    echo " "
  198. X    echo $nflag "Please choose again: " $cflag
  199. X    read os_name
  200. X    ;;
  201. X  esac
  202. X
  203. Xdone
  204. X
  205. Xecho " "
  206. Xecho " "
  207. Xecho you\'re on the following version of Unix: $NAME
  208. X
  209. Xecho " "
  210. Xecho "Now we can get down to those questions..."
  211. Xecho " "
  212. X
  213. Xcat << THE_END
  214. X
  215. XFirst off, should the program use "uuname" rather than trying to read 
  216. XTHE_END
  217. X
  218. Xnot_using_lsys_file=0
  219. X
  220. Xanswer="yes"
  221. Xecho $nflag "the L.sys file (y/n) [yes] ? "  $cflag
  222. Xread answer
  223. X
  224. Xif [ "$answer" = "n" -o "$answer" = "no" ]
  225. Xthen
  226. X  not_using_lsys_file=1
  227. X  echo "s/#define USE_UUNAME/\/** #define USE_UUNAME **\//" >> $SED1
  228. Xfi
  229. X
  230. Xcat << THE_END
  231. X
  232. XNext, are you running smail, a "gateway" configuration of sendmail, or some 
  233. Xother program that means the program shouldn't touch any of the addresses 
  234. XTHE_END
  235. X
  236. Xanswer="no"
  237. Xdont_touch_addresses=0
  238. Xecho $nflag "that users type in (y/n) [no] ? " $cflag
  239. Xread answer
  240. X
  241. Xif [ "$answer" = "y" -o "$answer" = "yes" ]
  242. Xthen
  243. X  dont_touch_addresses=1
  244. X  echo \
  245. X"s/\/\*\* #define DONT_TOUCH_ADDRESSES \*\*\//#define DONT_TOUCH_ADDRESSES /" \
  246. X  >> $SED1
  247. X  echo \
  248. X"s/\/\*\* #define DONT_OPTIMIZE_RETURN \*\*\//#define DONT_OPTIMIZE_RETURN /" \
  249. X  >> $SED1
  250. Xfi
  251. X
  252. Xcat << THE_END
  253. X
  254. XDoes your site receive mail with valid "Reply-To:" and "From:" fields in
  255. XTHE_END
  256. X
  257. Xanswer="no"
  258. Xecho $nflag "the headers (y/n) [no] ? " $cflag
  259. Xread answer
  260. X
  261. Xif [ "$answer" != "y" -a "$answer" != "yes" ]
  262. Xthen
  263. X  echo \
  264. X"s/#define USE_EMBEDDED_ADDRESSES/\/** #define USE_EMBEDDED_ADDRESSES **\//" \
  265. X  >> $SED1
  266. Xfi
  267. X
  268. Xcat << THE_END
  269. X
  270. X-------------------------------------------------------------------------------
  271. X
  272. XHow about memory?  If you have a lot, you can enter a fairly large number
  273. Xfor the next few questions...if not, you'll probably want to enter the
  274. Xsuggested small-system values.  (This applies to the speed of the swapping
  275. Xon your system too - if you're on a FAST system, use the big values!)
  276. X
  277. XFirst, how many aliases should be allowed for an individual user? The suggested
  278. Xvalues are 503 for blindly fast systems, 251 for average systems and 127 for
  279. XTHE_END
  280. X
  281. Xmax_ualiases="NONE"
  282. X
  283. Xwhile [ "$max_ualiases" = "NONE" ] 
  284. Xdo 
  285. X
  286. X  echo $nflag "slow systems.  Number of aliases [251] ? " $cflag 
  287. X
  288. X  read junk
  289. X
  290. X  if [ "$junk" = "" ] 
  291. X  then
  292. X    junk=251
  293. X  fi
  294. X
  295. X  if [ $junk -lt 50 -o $junk -gt 1000 ] 
  296. X  then
  297. X    echo \
  298. X"Pretty strange answer!  I think you should reconsider and try this question "\
  299. X    echo "again..."
  300. X    echo " "
  301. X  else
  302. X    max_ualiases=$junk
  303. X    echo "s/>251</$max_ualiases/" >> $SED1
  304. X    case $junk in
  305. X    127) default=223    ;;
  306. X    503) default=739    ;;
  307. X    *  ) default=503    ;;
  308. X    esac
  309. X  fi
  310. Xdone
  311. X
  312. Xmax_saliases="NONE"
  313. X
  314. Xwhile [ "$max_saliases" = "NONE" ] 
  315. Xdo 
  316. X
  317. X  echo $nflag "Max number of system aliases available  [$default] ? " $cflag
  318. X
  319. X  read junk
  320. X
  321. X  if [ "$junk" = "" ] 
  322. X  then
  323. X   junk=$default
  324. X  fi
  325. X
  326. X  if [ $junk -lt 50 -o $junk -gt 1000 ] 
  327. X  then
  328. X    echo "Pretty far out value for this question!  I think you should reconsider"
  329. X    echo "your answer and try this question again..."
  330. X    echo " "
  331. X  else
  332. X    max_saliases=$junk
  333. X    echo "s/>503</$max_saliases/" >> $SED1
  334. X  fi
  335. Xdone
  336. X
  337. Xcat << THE_END
  338. X
  339. XThe next pair of questions have to do with what to do when another program has 
  340. Xlocked a mailbox...
  341. X
  342. XFirst, how many times should the program check for the removal of the lock
  343. XTHE_END
  344. X
  345. Xdefault=6
  346. X
  347. Xmax_attempts="NONE"
  348. X
  349. Xwhile [ "$max_attempts" = "NONE" ] 
  350. Xdo 
  351. X
  352. X  echo $nflag "file before giving up? [6] " $cflag
  353. X
  354. X  read junk
  355. X
  356. X  if [ "$junk" = "" ] 
  357. X  then
  358. X   junk=$default
  359. X  fi
  360. X
  361. X  if [ $junk -lt 3 -o $junk -gt 10 ] 
  362. X  then
  363. X    echo \
  364. X"The recommended range is 3-10   ...Number of times to check lock"
  365. X  else
  366. X    max_attempts=$junk
  367. X    echo "s/>6</$max_attempts/" >> $SED1
  368. X  fi
  369. Xdone
  370. X
  371. Xecho " "
  372. Xanswer="no"
  373. Xecho $nflag "Should it REMOVE the lockfile after $max_attempts checks [no] ?" \
  374. X     $cflag
  375. Xread answer
  376. X
  377. Xif [ "$answer" != "y" -a "$answer" != "yes" ]
  378. Xthen
  379. X  echo \
  380. X"s/#define REMOVE_AT_LAST/\/** #define REMOVE_AT_LAST **\//" \
  381. X  >> $SED1
  382. Xfi
  383. X
  384. Xif [ "$NAME" = "BSD" ]
  385. Xthen 
  386. X  ps="ps -cax"
  387. Xelse
  388. X  ps="ps -ef"
  389. Xfi
  390. X
  391. Xecho " "
  392. Xecho " "
  393. Xecho "poking about a bit.."
  394. X
  395. Xresult="`$ps | grep sendmail | grep -v grep`"
  396. X
  397. Xif [ "$result" = "" ]
  398. Xthen
  399. X  if [ -f /usr/lib/sendmail -a -f /usr/lib/sendmail.cf ]
  400. X  then
  401. X    echo \(sendmail available - assuming you don\'t run it as a daemon\)
  402. X    result="ok"
  403. X  fi
  404. Xfi
  405. X
  406. Xif [ "$result" != "" ]
  407. Xthen
  408. X  echo "You're running sendmail.  Well done, I guess..."
  409. X  echo "s/\/\*\* #define ALLOW_BCC \*\*\//#define ALLOW_BCC/" \
  410. X    >> $SED1
  411. X  echo "s/\/\*\* #define DONT_ADD_FROM \*\*\//#define DONT_ADD_FROM/" \
  412. X    >> $SED1
  413. X    echo \
  414. X "s/#define USE_DOMAIN/\/** #define USE_DOMAIN **\//" \
  415. X    >> $SED1
  416. Xelse
  417. X
  418. X  cat << THE_END
  419. X
  420. XSince you're not running sendmail, should I check local user entered addresses
  421. XTHE_END
  422. X
  423. Xanswer="yes"
  424. Xecho $nflag "against the valid mailboxes on this system [yes] ? " $cflag
  425. Xread answer
  426. X
  427. Xif [ "$answer" != "y" -a "$answer" != "yes" -a "$answer" != "" ]
  428. Xthen
  429. X  echo \
  430. X"s/#define NOCHECK_VALIDNAME/\/** #define NOCHECK_VALIDNAME **\//" \
  431. X  >> $SED1
  432. Xfi
  433. X
  434. Xcat << THE_END
  435. X
  436. XAre you running a machine where you want to have a domain name appended to the
  437. XTHE_END
  438. X
  439. Xanswer="yes"
  440. Xecho $nflag "hostname on outbound mail [no] ? " $cflag
  441. Xread answer
  442. X
  443. Xif [ "$answer" != "y" -a "$answer" != "yes" ]
  444. Xthen
  445. X    echo \
  446. X "s/#define USE_DOMAIN/\/** #define USE_DOMAIN **\//" \
  447. X    >> $SED1
  448. Xelse
  449. X  echo " "
  450. X  echo $nflag "Enter the domain name (include leading '.') : " $cflag
  451. X  read answer
  452. X  echo "s/<enter your domain here>/$answer/" >> $SED1
  453. Xfi
  454. X
  455. Xfi
  456. X
  457. X# next let's see if we can find the vfork command on this system..
  458. X
  459. Xcat << EOF > .test.c
  460. Xmain()
  461. X{
  462. X    (void) vfork();
  463. X}
  464. XEOF
  465. X
  466. Xif [ "$NAME" = "UTS" ]
  467. Xthen
  468. Xcat << EOF > .vfork
  469. Xcc -la .test.c
  470. XEOF
  471. Xelse
  472. Xcat << EOF > .vfork
  473. Xcc .test.c
  474. XEOF
  475. Xfi
  476. X
  477. Xsh .vfork > .log 2>& 1
  478. X
  479. Xif [ "`cat .log | wc -l`" -eq "0" ]
  480. Xthen
  481. X  echo "You have virtual memory system calls available.  Cool..."
  482. Xelse
  483. X  cat << THE_END
  484. X
  485. XYour machine doesn't seem to have the vfork command available.  Should I assume
  486. XTHE_END
  487. X
  488. X  answer="no"
  489. X  echo $nflag "you have it, anyway [no] ? " $cflag
  490. X  read answer
  491. X
  492. Xif [ "$answer" != "y" -a "$answer" != "yes" ]
  493. X  then
  494. X    echo "s/\/\*\* #define NO_VM \*\*\//#define NO_VM/" >> $SED1
  495. X  fi
  496. Xfi
  497. X
  498. X$rm -f a.out .test.c .vfork .log
  499. X
  500. X# next let's see if we have the gethostname() system call...
  501. X
  502. Xcat << EOF > .test.c
  503. Xmain()
  504. X{
  505. X    (void) gethostname();
  506. X}
  507. XEOF
  508. X
  509. Xcat << EOF > .hostname
  510. Xcc .test.c
  511. XEOF
  512. X
  513. Xsh .hostname > .log 2>& 1
  514. X
  515. Xif [ "`cat log | wc -l`" -eq "0" ]
  516. Xthen
  517. X  echo "You have the 'gethostname()' system call..."
  518. Xelse
  519. X  echo "s/\/\*\* #define NEED_GETHOSTNAME \*\*\//#define NEED_GETHOSTNAME/" \
  520. X  >> $SED1
  521. Xfi
  522. X
  523. X$rm -f a.out .test.c .hostname .log
  524. X
  525. X# next let's see if we have long variable names...
  526. X
  527. Xcat << EOF > .test.c
  528. Xmain()
  529. X{
  530. X    int this_is_a_long_variable=0;
  531. X
  532. X    (void) this_is_a_long_variable_routine_name(this_is_a_long_variable);
  533. X    
  534. X}
  535. Xthis_is_a_long_variable_routine_name() { }
  536. XEOF
  537. X
  538. Xcat << EOF > .varname
  539. Xcc .test.c
  540. XEOF
  541. X
  542. Xsh .varname > .log 2>& 1
  543. X
  544. Xif [ "`cat .log | wc -l`" -eq "0" ]
  545. Xthen
  546. X  echo "You have long variable names.  Well done!!!!!"
  547. Xelse
  548. X  echo "How embarassing.  Your C compiler doesn't support long variables..."
  549. X  echo "s/\/\*\* #define SHORTNAMES \*\*\//#define SHORTNAMES/" \
  550. X  >> $SED1
  551. Xfi
  552. X
  553. X$rm -f a.out .test.c .varname .log
  554. X
  555. Xif [ $dont_touch_addresses = 0 ]
  556. Xthen
  557. Xcat << THE_END
  558. X
  559. XWhen given a machine that you talk to directly, should the 'pathalias' route to
  560. XTHE_END
  561. X
  562. X answer="no"
  563. X echo $nflag "the machine be used instead [no] ? " $cflag
  564. X read answer
  565. X
  566. X if [ "$answer" != "y" -a "$answer" != "yes" ]
  567. X then
  568. X    echo \
  569. X "s/#define LOOK_CLOSE_AFTER_SEARCH/\/** #define LOOK_CLOSE_AFTER_SEARCH **\//"\
  570. X    >> $SED1
  571. X fi
  572. Xfi
  573. X
  574. Xanswer="yes"
  575. Xecho " "
  576. Xecho $nflag "Is the preferred address notation 'user@host' [yes] ?" $cflag
  577. Xread answer
  578. X
  579. Xif [ "$answer" != "y" -a "$answer" != "yes" -a  "$answer" != "" ]
  580. Xthen
  581. X    echo \
  582. X "s/#define INTERNET_ADDRESS_FORMAT/\/** #define INTERNET_ADDRESS_FORMAT **\//" \
  583. X    >> $SED1
  584. Xfi
  585. X
  586. Xecho " "
  587. Xanswer="yes"
  588. Xecho $nflag "Am I going to be running as a setgid program [yes] ? "$cflag
  589. Xread answer
  590. X
  591. Xif [ "$answer" != "y" -a "$answer" != "yes" -a "$answer" != "" ]
  592. Xthen
  593. X  echo answer is currently equal to \"$answer\"
  594. X  echo \
  595. X "s/#define SAVE_GROUP_MAILBOX_ID/\/** #define SAVE_GROUP_MAILBOX_ID **\//" \
  596. X    >> $SED1
  597. Xfi
  598. X    
  599. Xcat << THE_END
  600. X
  601. X
  602. XFor any of the questions after this point, you can press RETURN if the 
  603. Xquestions doesn't apply, or there's no reasonable answer...
  604. X
  605. XTHE_END
  606. X
  607. Xif [ $dont_touch_addresses = 0 ]
  608. Xthen 
  609. X if [ ! -f /usr/lib/nmail.paths ] 
  610. X then
  611. X   echo $nflag "Where does the output of pathalias live ? " $cflag
  612. X   read answer
  613. X
  614. X   if [ "$answer" != "" ]
  615. X   then
  616. X     echo "s^/usr/lib/nmail.paths^$answer^" >> $SED1
  617. X   fi
  618. X fi
  619. Xfi
  620. X
  621. Xuse_dbm=0
  622. X
  623. Xif [ $dont_touch_addresses = 0 ]
  624. Xthen
  625. X  if [ -f $answer.pag -a -f $answer.dir ]
  626. X  then
  627. X    echo "You have pathalias as a DBM file...I'll use that instead."
  628. X    echo "s^/\*\* #define USE_DBM \*\*/^#define USE_DBM^" >> $SED1
  629. X    use_dbm=1
  630. X  fi
  631. Xfi
  632. X
  633. Xcase $OS_FLAG in 
  634. X  BSD) echo "s/>os-define</-DBSD/"    >> $SED2
  635. X       echo "s/>lib2</-lcurses/"      >> $SED2
  636. X       if [ $use_dbm = 1 ]
  637. X       then
  638. X         echo "s/>libs</-ltermcap -ldbm/" >> $SED2
  639. X       else
  640. X         echo "s/>libs</-ltermcap/"       >> $SED2
  641. X       fi
  642. X       ;;
  643. X
  644. X  PYRAMID) echo "s/>os-define</"-DBSD -DNO_VAR_ARGS"/" >> $SED2
  645. X       echo "s/>lib2</-lcurses/"      >> $SED2
  646. X       if [ $use_dbm = 1 ]
  647. X       then
  648. X         echo "s/>libs</-ltermcap -ldbm/"     >> $SED2
  649. X       else
  650. X         echo "s/>libs</-ltermcap/"     >> $SED2
  651. X       fi
  652. X       ;;
  653. X
  654. X  UTS) echo "s/>os-define</-DUTS/"    >> $SED2
  655. X       echo "s/>lib2</-la -lq/"       >> $SED2
  656. X       if [ $use_dbm = 1 ]
  657. X       then
  658. X         echo "s/>libs</-lcurses -ldbm/" >> $SED2
  659. X       else
  660. X         echo "s/>libs</-lcurses/"       >> $SED2
  661. X       fi
  662. X       ;;
  663. X
  664. X  *)   echo "s/>os-define<//"         >> $SED2
  665. X       echo "s/>lib2<//"              >> $SED2
  666. X       if [ $use_dbm = 1 ] 
  667. X       then
  668. X         echo "s/>libs</-ltermcap -ldbm/" >> $SED2
  669. X       else
  670. X         echo "s/>libs</-ltermcap/"       >> $SED2
  671. X       fi
  672. X       ;;
  673. X
  674. Xesac
  675. X
  676. Xif [ $dont_touch_addresses = 0 ]
  677. Xthen
  678. X if [ ! -f /usr/lib/domains ] 
  679. X then
  680. X   echo $nflag "Where does the 'domains' file live ? " $cflag
  681. X   read answer
  682. X
  683. X   if [ "$answer" != "" ]
  684. X   then
  685. X     echo "s^/usr/lib/domains^$answer^" >> $SED1
  686. X   fi
  687. X fi
  688. Xfi
  689. X
  690. Xif [ $not_using_lsys_file = 1 ]
  691. Xthen
  692. X  if [ ! -f /usr/lib/uucp/L.sys ]
  693. X  then
  694. X    echo $nflag "Where does the 'L.sys' file live ? " $cflag
  695. X    read answer
  696. X
  697. X    if [ "$answer" != "" ]
  698. X    then
  699. X      echo "s^/usr/lib/uucp/L.sys^$answer^" >> $SED1
  700. X    fi
  701. X  fi
  702. Xfi
  703. Xif [ ! -d /tmp ]
  704. Xthen 
  705. X  echo $nflag "/tmp isn't a directory!  What should I use?? " $cflag
  706. X  read answer
  707. X
  708. X  if [ "$answer" != "" ]
  709. X  then
  710. X    echo "s^/tmp^$answer^" >> $SED1
  711. X  fi
  712. Xfi
  713. X
  714. Xif [ ! -f /usr/ucb/vi -a "$os_name" = "BSD" ]
  715. Xthen
  716. X  echo $nflag "I can't find the 'vi' editor!  Where is it? " $cflag
  717. X  read answer
  718. X
  719. X  if [ "$answer" != "" ]
  720. X  then
  721. X    echo "s^/usr/ucb/vi^$answer^" >> $SED1
  722. X  fi
  723. Xelif [ ! -f /usr/bin/vi -a "$os_name" = "" ]
  724. Xthen
  725. X  echo $nflag \
  726. X    "I can't find the 'vi' editor!  Where is it? " $cflag
  727. X  read answer
  728. X
  729. X  if [ "$answer" != "" ]
  730. X  then
  731. X    echo "s^/usr/bin/vi^$answer^" >> $SED1
  732. X  fi
  733. Xfi
  734. X
  735. Xif [ ! -d /usr/spool/mail -a "$os_name" = "BSD" ]
  736. Xthen
  737. X  echo $nflag "I can't find your inbound mail directory!  Where is it? " $cflag
  738. X  read answer
  739. X
  740. X  if [ "$answer" != "" ]
  741. X  then
  742. X    echo "s^/usr/spool/mail^$answer^" >> $SED1
  743. X  fi
  744. Xelif [ ! -d /usr/mail -a "$os_name" = "" ]
  745. Xthen
  746. X  echo $nflag "I can't find your inbound mail directory!  Where is it? " $cflag
  747. X  read answer
  748. X
  749. X  if [ "$answer" != "" ]
  750. X  then
  751. X    echo "s^/usr/mail^$answer^" >> $SED1
  752. X  fi
  753. Xfi
  754. X
  755. Xif [ ! -f /bin/rm ]
  756. Xthen
  757. X  echo $nflag "Where's the 'rm' program? " $cflag
  758. X  read answer
  759. X
  760. X  if [ "$answer" != "" ]
  761. X  then
  762. X    echo "s^/bin/rm^$answer^" >> $SED1
  763. X  fi
  764. Xfi
  765. X
  766. Xif [ ! -f /bin/cat ]
  767. Xthen
  768. X  echo $nflag "Where's the 'cat' program? " $cflag
  769. X  read answer
  770. X
  771. X  if [ "$answer" != "" ]
  772. X  then
  773. X    echo "s^/bin/rm^$answer^" >> $SED1
  774. X  fi
  775. Xfi
  776. Xif [ ! -c /dev/rct ]
  777. Xthen
  778. X  if [ ! -c /dev/rmt ]
  779. X  then
  780. X    echo $nflag "What's the name of your remote-tape unit? " $cflag
  781. X    read answer
  782. X
  783. X    if [ "$answer" = "" ]
  784. X    then
  785. X      echo "s^>tapeunit<^unknown-remote-tape-unit^" >> $SED2
  786. X    else
  787. X      if [ ! -c $answer ] 
  788. X      then
  789. X    if [ -c /dev/$answer ]
  790. X    then
  791. X          echo "s^>tapeunit<^/dev/$answer^" >> $SED2
  792. X        else
  793. X          echo \
  794. X           "I can't find either $answer or /dev/$answer.  I'll set it to junk" 
  795. X          echo "s^>tapeunit<^unknown-remote-tape-unit^" >> $SED2
  796. X        fi
  797. X      else
  798. X        echo "s^>tapeunit<^$answer^" >> $SED2
  799. X      fi
  800. X    fi
  801. X  else
  802. X    echo "s^>tapeunit<^/dev/rmt^" >> $SED2
  803. X  fi
  804. Xelse
  805. X  echo "s^>tapeunit<^/dev/rct^" >> $SED2
  806. Xfi
  807. X
  808. Xif [ ! -d /usr/local/bin ]
  809. Xthen
  810. X  echo $nflag "Where do you want the system software installed? " $cflag
  811. X  read answer
  812. X
  813. X  if [ "$answer" = "" ]
  814. X  then
  815. X    echo "s^>dest-dir<^unknown-destination-directory^" >> $SED2
  816. X  else
  817. X    if [ -d $answer ]
  818. X    then
  819. X      echo "s^>dest-dir<^$answer^" >> $SED2
  820. X    else
  821. X      echo "I don't know what you're talking about.  I'll set it to junk" 
  822. X      echo "s^>dest-dir<^unknown-destination-directory^" >> $SED2
  823. X    fi
  824. X  fi
  825. Xelse
  826. X  echo "s^>dest-dir<^/usr/local/bin^" >> $SED2
  827. Xfi
  828. X
  829. Xif [ ! -f /usr/bin/troff ]
  830. Xthen
  831. X  if [ ! -f /usr/local/bin/troff ]
  832. X  then
  833. X    if [ ! -f /usr/contrib/bin/troff ]
  834. X    then
  835. X      if [ ! -f /usr/ucb/troff ]
  836. X      then
  837. X        if [ ! -f /bin/troff ]
  838. X        then
  839. X          echo $nflag "Where does the 'troff' program live? " $cflag
  840. X       read answer
  841. X
  842. X      if [ "$answer" = "" ]
  843. X      then
  844. X            echo "s/>troff</nroff/" >> $SED2
  845. X      else
  846. X            if [ -f $answer ]
  847. X        then
  848. X              echo "s^>troff<^$answer^" >> $SED2
  849. X              troff=$answer
  850. X        else
  851. X          echo "Still can't find it.  I'll set it to \"nroff\" instead."
  852. X              echo "s/>troff</nroff/" >> $SED2
  853. X        fi
  854. X      fi
  855. X    else
  856. X          echo "s^>troff<^/bin/troff^" >> $SED2
  857. X          troff=/bin/troff
  858. X        fi
  859. X      else
  860. X        echo "s^>troff<^/usr/ucb/troff^" >> $SED2
  861. X        troff=/usr/ucb/troff
  862. X      fi
  863. X    else
  864. X      echo "s^>troff<^/usr/contrib/bin/troff^" >> $SED2
  865. X      troff=/usr/contribbin/troff
  866. X    fi
  867. X  else
  868. X    echo "s^>troff<^/usr/local/bin/troff^" >> $SED2
  869. X    troff=/usr/local/bin/troff
  870. X  fi
  871. Xelse
  872. X  echo "s^>troff<^/usr/bin/troff^" >> $SED2
  873. X  troff=/usr/bin/troff
  874. Xfi
  875. X
  876. X# phew!
  877. X
  878. Xtroffdir=`dirname $troff`
  879. X
  880. Xif [ -f $troffdir/tbl ]
  881. Xthen
  882. X  echo "s^>tbl<^$troffdir/tbl^" >> $SED2
  883. Xelse
  884. X  echo $nflag "Where does the 'tbl' program live? " $cflag
  885. X  read answer
  886. X
  887. X  if [ "$answer" = "" ]
  888. X  then
  889. X    echo "s^>tbl<^cat^" >> $SED2
  890. X  elif [ -f $answer ]
  891. X  then
  892. X    echo "s^>tbl<^$answer^" >> $SED2
  893. X  else
  894. X    echo "I can't find that either.  I'll just set it to junk..."
  895. X    echo "s^>tbl<^cat^" >> $SED2
  896. X  fi
  897. Xfi
  898. X
  899. Xif [ -f /bin/cc ]
  900. Xthen
  901. X  echo "s^>cc<^/bin/cc^" >> $SED2
  902. Xelse
  903. X  echo $nflag "Where does the 'C' compiler live? " $cflag
  904. X  read answer
  905. X
  906. X  if [ "$answer" = "" ]
  907. X  then
  908. X    cat << THE_END
  909. X
  910. XI hope you realize that without a "C" compiler there's no point in doing any
  911. Xof this.  If we can't compile anything then this is just so much disk filler.
  912. X
  913. XIn fact, thinking about it, let's just quit right now.
  914. X
  915. XTHE_END
  916. X
  917. X    exit 1
  918. X  fi
  919. X
  920. X  if [ -f $answer ]
  921. X  then
  922. X    echo "s^>cc<^$answer^" >> $SED2
  923. X  else
  924. X    cat << THE_END
  925. X
  926. XI couldn't find what you specified, pal.  I hope you realize that without a 
  927. X"C" compiler there's no point in doing any of this.  If we can't compile 
  928. Xanything then this system is just so much disk filler.
  929. X
  930. XIn fact, thinking about it, let's just quit right now.
  931. X
  932. XTHE_END
  933. X    exit 1
  934. X  fi
  935. Xfi
  936. X
  937. Xecho "s^>rm<^$rm -f^" >> $SED2
  938. X
  939. Xif [ -f /bin/mv ]
  940. Xthen
  941. X  echo "s^>mv<^/bin/mv -f^" >> $SED2
  942. Xelse
  943. X  echo "s^>mv<^mv -f^" >> $SED2  
  944. Xfi
  945. X
  946. Xif [ -f /bin/cp ]
  947. Xthen
  948. X  echo "s^>cp<^/bin/cp^" >> $SED2
  949. Xelse
  950. X  echo "s^>cp<^cp^" >> $SED2  
  951. Xfi
  952. X
  953. Xcat << END
  954. X
  955. XThat's it.  Just  have to do some patching up and such...hang loose for a 
  956. Xminute or two, please...
  957. X
  958. XEND
  959. X
  960. X# process the four Makefiles accordingly...
  961. X
  962. Xecho "1 - processing the file \"Makefile\"..."
  963. Xcat Makefile.mstr | sed -f $SED2 > Makefile
  964. X
  965. Xecho "2 - processing the file \"src/Makefile\"..."
  966. Xcat src/Makefile.mstr | sed -f $SED2 > src/Makefile
  967. X
  968. Xecho "3 - processing the file \"utils/Makefile\"..."
  969. Xcat utils/Makefile.mstr | sed -f $SED2 > utils/Makefile
  970. X
  971. Xecho "4 - processing the file \"filter/Makefile\"..."
  972. Xcat filter/Makefile.mstr | sed -f $SED2 > filter/Makefile
  973. X
  974. X# then filter the sysdefs file through the sed script we've created!
  975. X
  976. Xecho "Finally, processing the file \"hdrs/sysdefs.h\"..."
  977. X
  978. Xif [ -f hdrs/sysdefs.h ]
  979. Xthen
  980. X  mv hdrs/sysdefs.h hdrs/sysdefs.old
  981. Xfi
  982. X
  983. Xcat hdrs/sysdefs.master | sed -f $SED1 > hdrs/sysdefs.h
  984. X
  985. Xecho Done\!
  986. X
  987. X$rm -f $SED1 $SED2
  988. Xexit 0
  989. END_OF_Configure.sh
  990. if test 20310 -ne `wc -c <Configure.sh`; then
  991.     echo shar: \"Configure.sh\" unpacked with wrong size!?
  992. fi
  993. chmod +x Configure.sh
  994. # end of overwriting check
  995. fi
  996. echo shar: End of shell archive.
  997. exit 0
  998.